package com.hao.order.app.model.enums;

/**
 * @author haoge
 * @version 1.0
 * @date 2023/5/24 21:53
 */
public enum OrderStatusEnum {
    ORDER_WAIT_PAY(1,"待付款"),
    ORDER_WAIT_SHIPMENTS(2,"待发货"),
    ORDER_WAIT_RECEIVE(3,"待收货"),
    ORDER_FINISH(4,"完成"),
    ORDER_CANCEL(5,"已取消");

    private Integer status;
    private String value;

    OrderStatusEnum(Integer status, String value) {
        this.status = status;
        this.value = value;
    }

    public static OrderStatusEnum getOrderStatusEnumByValue(Integer value) {
        if (value == null) {
            return null;
        }
        OrderStatusEnum[] values = OrderStatusEnum.values();
        for (OrderStatusEnum orderStatusEnum : values) {
            if (orderStatusEnum.getStatus().equals(value)) {
                return orderStatusEnum;
            }
        }
        return null;
    }
    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    public String getValue() {
        return value;
    }

    public void setValue(String value) {
        this.value = value;
    }
}
